//import kotlinx.cinterop.ExperimentalForeignApi
//import platform.posix.EOF
//import platform.posix.fclose
//import platform.posix.fgetc
//import platform.posix.fopen
//import platform.posix.fputs
//
//@OptIn(ExperimentalForeignApi::class)
//fun writeFile(filePath: String, content: String) {
//    val file = fopen(filePath, "w") ?: throw Exception("File cannot be opened")
//    fputs(content, file)
//    fclose(file)
//}
//
//@OptIn(ExperimentalForeignApi::class)
//fun readFile(filePath: String): String {
//    val file = fopen(filePath, "r") ?: throw Exception("File cannot be opened")
//    val content = mutableListOf<Char>()
//    var c: Int
//    while (true) {
//        c = fgetc(file)
//        if (c == EOF) break
//        content.add(c.toChar())
//    }
//    fclose(file)
//    return content.joinToString("")
//}
